#!/bin/bash
# This script is used to start the MoviePilot v2 Docker container.
docker stop moviepilot-v2
docker rm moviepilot-v2
# Pull the latest image
docker run -itd \
    --name moviepilot-v2 \
    --hostname moviepilot-v2 \
    --network host \
    -v ./media:/media \
    -v ./moviepilot-v2/config:/config \
    -v ./moviepilot-v2/core:/moviepilot/.cache/ms-playwright \
    -v /var/run/docker.sock:/var/run/docker.sock:ro \
    -e 'NGINX_PORT=3000' \
    -e 'PORT=3001' \
    -e 'PUID=0' \
    -e 'PGID=0' \
    -e 'UMASK=000' \
    -e 'TZ=Asia/Shanghai' \
    -e 'SUPERUSER=admin' \
    --restart always \
    jxxghp/moviepilot-v2:latest